#include "test.pb.h"
#include <iostream>

int main()
{
    fixbug::LoginRequest req;
    req.set_name("liming");
    req.set_pwd("123456");

    std::string send_str;
    if (req.SerializeToString(&send_str))
    {
        for (char c : send_str)
        {
            printf("%02x ", static_cast<unsigned char>(c));
        }
    }
    fixbug::LoginRequest reqB;
    if (reqB.ParseFromString(send_str))
    {
        std::cout << std::endl << reqB.name() << reqB.pwd() << std::endl;
    }

    fixbug::LoginResponse rsp;
    fixbug::ResultCode *rc = rsp.mutable_result();
    rc->set_errcode(1);
    rc->set_errmsg("登陆处理失败了");

    fixbug::GetFrinedListResponse frsp;
    fixbug::ResultCode *rc1 = frsp.mutable_result();
    rc1->set_errcode(1);
    rc1->set_errmsg("登陆处理失败了");

    fixbug::User *use1 = frsp.add_friend_list();
    use1->set_name("liming");
    use1->set_age(26);
    use1->set_sex(fixbug::User::MAN);
    
    fixbug::User *use2 = frsp.add_friend_list();
    use1->set_name("azq");
    use1->set_age(26);
    use1->set_sex(fixbug::User::MAN);

    std::cout << frsp.friend_list_size() << std::endl;

    return 0;
}